<template>
    <el-select v-model="applicationStore.code" style="width: 240px">
        <el-option-group v-for="group in groups" :key="group.label" :label=" group.label">
            <el-option v-for="item in group.options" :label="item.label" :value="item.value" :key="item.value"></el-option>
        </el-option-group>
    </el-select>
</template>

<script lang="ts" setup>
import { getGroupOptions } from '@/api/application'
import { useApplicationStore } from '@/store/modules/application'

// const modelValue = defineModel({
//     type: String,
//     required: true
// })

const applicationStore = useApplicationStore()

const groups = ref<OptionGroup[]>()

onMounted(async () => {
    groups.value = await getGroupOptions()
})

</script>